package sk.vrto.service.crypto;

import java.util.Random;

/**
 * Generator for salts.
 * @see SaltedAESStringEncrypter
 */
public class SaltGenerator {

    private static final String SALT = "Abkhazia\n" +
                    "Afghanistan\n" +
                    "Akrotiri and Dhekelia\n" +
                    "Aland\n" +
                    "Albania\n" +
                    "Algeria\n" +
                    "American Samoa\n" +
                    "Andorra\n" +
                    "Angola\n" +
                    "Anguilla\n" +
                    "Antigua and Barbuda\n" +
                    "Argentina\n" +
                    "Armenia\n" +
                    "Aruba\n" +
                    "Ascension Island\n" +
                    "Australia\n" +
                    "Austria\n" +
                    "Azerbaijan\n" +
                    "Bahamas, The\n" +
                    "Bahrain\n" +
                    "Bangladesh\n" +
                    "Barbados\n" +
                    "Belarus\n" +
                    "Belgium\n" +
                    "Belize\n" +
                    "Benin\n" +
                    "Bermuda\n" +
                    "Bhutan\n" +
                    "Bolivia\n" +
                    "Bosnia and Herzegovina\n" +
                    "Botswana\n" +
                    "Brazil\n" +
                    "Brunei\n" +
                    "Bulgaria\n" +
                    "Burkina Faso\n" +
                    "Burundi\n" +
                    "Cambodia\n" +
                    "Cameroon\n" +
                    "Canada\n" +
                    "Cape Verde\n" +
                    "Cayman Islands\n" +
                    "Central Africa Republic\n" +
                    "Chad\n" +
                    "Chile\n" +
                    "China\n" +
                    "Christmas Island\n" +
                    "Cocos (Keeling) Islands\n" +
                    "Colombia\n" +
                    "Comoros\n" +
                    "Congo\n" +
                    "Cook Islands\n" +
                    "Costa Rica\n" +
                    "Cote d'lvoire\n" +
                    "Croatia\n" +
                    "Cuba\n" +
                    "Cyprus\n" +
                    "Czech Republic\n" +
                    "Denmark\n" +
                    "Djibouti\n" +
                    "Dominica\n" +
                    "Dominican Republic\n" +
                    "East Timor Ecuador\n" +
                    "Egypt\n" +
                    "El Salvador\n" +
                    "Equatorial Guinea\n" +
                    "Eritrea\n" +
                    "Estonia\n" +
                    "Ethiopia\n" +
                    "Falkland Islands\n" +
                    "Faroe Islands\n" +
                    "Fiji\n" +
                    "Finland\n" +
                    "France\n" +
                    "French Polynesia\n" +
                    "Gabon\n" +
                    "Cambia, The\n" +
                    "Georgia\n" +
                    "Germany\n" +
                    "Ghana\n" +
                    "Gibraltar\n" +
                    "Greece\n" +
                    "Greenland\n" +
                    "Grenada\n" +
                    "Guam\n" +
                    "Guatemala\n" +
                    "Guemsey\n" +
                    "Guinea\n" +
                    "Guinea-Bissau\n" +
                    "Guyana\n" +
                    "Haiti\n" +
                    "Honduras\n" +
                    "Hong Kong\n" +
                    "Hungary\n" +
                    "Iceland\n" +
                    "India\n" +
                    "Indonesia\n" +
                    "Iran\n" +
                    "Iraq\n" +
                    "Ireland\n" +
                    "Isle of Man\n" +
                    "Israel\n" +
                    "Italy\n" +
                    "Jamaica\n" +
                    "Japan\n" +
                    "Jersey\n" +
                    "Jordan\n" +
                    "Kazakhstan\n" +
                    "Kenya\n" +
                    "Kiribati\n" +
                    "Korea, N\n" +
                    "Korea, S\n" +
                    "Kosovo\n" +
                    "Kuwait\n" +
                    "Kyrgyzstan\n" +
                    "Laos\n" +
                    "Latvia\n" +
                    "Lebanon\n" +
                    "Lesotho\n" +
                    "Liberia\n" +
                    "Libya\n" +
                    "Liechtenstein\n" +
                    "Lithuania\n" +
                    "Luxembourg\n" +
                    "Macao\n" +
                    "Macedonia\n" +
                    "Madagascar\n" +
                    "Malawi\n" +
                    "Malaysia\n" +
                    "Maldives\n" +
                    "Mali\n" +
                    "Malta\n" +
                    "Marshall Islands\n" +
                    "Mauritania\n" +
                    "Mauritius\n" +
                    "Mayotte\n" +
                    "Mexico\n" +
                    "Micronesia\n" +
                    "Moldova\n" +
                    "Monaco\n" +
                    "Mongolia\n" +
                    "Montenegro\n" +
                    "Montserrat\n" +
                    "Morocco\n" +
                    "Mozambique\n" +
                    "Myanmar\n" +
                    "Nagorno-Karabakh\n" +
                    "Namibia\n" +
                    "Nauru\n" +
                    "Nepal\n" +
                    "Netherlands\n" +
                    "Netherlands Antilles\n" +
                    "New Caledonia\n" +
                    "New Zealand\n" +
                    "Nicaragua\n" +
                    "Niger\n" +
                    "Nigeria\n" +
                    "Niue\n" +
                    "Norfolk Island\n" +
                    "Northern Cyprus\n" +
                    "Northern Mariana Islands\n" +
                    "Norway\n" +
                    "Oman\n" +
                    "Pakistan\n" +
                    "Palau\n" +
                    "Palestine\n" +
                    "Panama\n" +
                    "Papua New Guinea\n" +
                    "Paraguay\n" +
                    "Peru\n" +
                    "Philippines\n" +
                    "Pitcaim Islands\n" +
                    "Poland\n" +
                    "Portugal\n" +
                    "Puerto Rico\n" +
                    "Qatar\n" +
                    "Romania\n" +
                    "Russia\n" +
                    "Rwanda\n" +
                    "Sahrawi Arab Democratic Republic\n" +
                    "Saint-Barthelemy\n" +
                    "Saint Helena\n" +
                    "Saint Kitts and Nevis\n" +
                    "Saint Lucia\n" +
                    "Saint Martin\n" +
                    "Saint Pierre and Miquelon\n" +
                    "Saint Vincent and Grenadines\n" +
                    "Samos\n" +
                    "San Marino\n" +
                    "Sao Tome and Principe\n" +
                    "Saudi Arabia\n" +
                    "Senegal\n" +
                    "Serbia\n" +
                    "Seychelles\n" +
                    "Sierra Leone\n" +
                    "Singapore\n" +
                    "Slovakia\n" +
                    "Slovenia\n" +
                    "Solomon Islands\n" +
                    "Somalia\n" +
                    "Somaliland\n" +
                    "South Africa\n" +
                    "South Ossetia\n" +
                    "Spain\n" +
                    "Sri Lanka\n" +
                    "Sudan\n" +
                    "Suriname\n" +
                    "Svalbard\n" +
                    "Swaziland\n" +
                    "Sweden\n" +
                    "Switzerland\n" +
                    "Syria\n" +
                    "Tajikistan\n" +
                    "Tanzania\n" +
                    "Thailand\n" +
                    "Togo\n" +
                    "Tokelau\n" +
                    "Tonga\n" +
                    "Transnistria\n" +
                    "Trinidad and Tobago\n" +
                    "Tristan da Cunha\n" +
                    "Tunisia\n" +
                    "Turkey\n" +
                    "Turkmenistan\n" +
                    "Turks and Caicos Islands\n" +
                    "Tuvalu\n" +
                    "Uganda\n" +
                    "Ukraine\n" +
                    "United Arab Emirates\n" +
                    "United Kingdom\n" +
                    "United States\n" +
                    "Uruguay\n" +
                    "Uzbekistan\n" +
                    "Vanuatu\n" +
                    "Vatican City\n" +
                    "Venezuela\n" +
                    "Vietnam\n" +
                    "Virgin Islands, British\n" +
                    "Virgin Islands, U.S.\n" +
                    "Wallis and Futuna\n" +
                    "Yemen\n" +
                    "Zambia\n" +
                    "Zimbabwe";

    private static final String[] SALTS;
    private static final Random RANDOM = new Random(System.currentTimeMillis());

    static {
        SALTS = SALT.split("\n");
    }


    /**
     * @return random salt string
     */
    public String nextSalt() {
        return SALTS[RANDOM.nextInt(SALTS.length)];
    }

}
